package com.mjh.controller;

import com.mjh.bean.Role;
import com.mjh.bean.UserRole;
import com.mjh.model.R;
import com.mjh.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@RequestMapping("/api/role")
@RestController
public class RoleController {
    @Autowired
    private RoleService roleService;
    /**
     * 查询所有角色信息
     * @return
     */
    @GetMapping("/list")
    public R<List<Role>> queryAllRoles() {
        List<Role> roles = roleService.queryAllRoles();
        return R.OK(roles);
    }

}
